﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Dzzzr
{
  public partial class MarkerInfo
  {
    private string _Name;

    private string description;

    private double _Latitude;

    private double _Longitude;

    private System.Nullable<double> delay;

    private System.DateTime _Time;

    private System.Nullable<double> _Speed;

    private System.Nullable<double> _Altitude;

    private int _ID;

    public MarkerInfo()
    {
    }

    public MarkerInfo(int id, string name, double latitude, double longitude, DateTime time, Nullable<double> speed, Nullable<double> altitude, Nullable<double> delay, string description)
    {
      this._Name = name;
      this._Latitude = latitude;
      this._Longitude = longitude;
      this._Time = time;
      this._Speed = speed;
      this._Altitude = altitude;
      this._ID = id;
      this.delay = delay;
      this.description = description;
    }

    public string Name
    {
      get
      {
        return this._Name;
      }
      set
      {
        if ((this._Name != value))
        {
          this._Name = value;
        }
      }
    }

    public double Latitude
    {
      get
      {
        return this._Latitude;
      }
      set
      {
        if ((this._Latitude != value))
        {
          this._Latitude = value;
        }
      }
    }

    public double Longitude
    {
      get
      {
        return this._Longitude;
      }
      set
      {
        if ((this._Longitude != value))
        {
          this._Longitude = value;
        }
      }
    }

    public System.DateTime Time
    {
      get
      {
        return this._Time;
      }
      set
      {
        if ((this._Time != value))
        {
          this._Time = value;
        }
      }
    }

    public System.Nullable<double> Speed
    {
      get
      {
        return this._Speed;
      }
      set
      {
        if ((this._Speed != value))
        {
          this._Speed = value;
        }
      }
    }

    public System.Nullable<double> Altitude
    {
      get
      {
        return this._Altitude;
      }
      set
      {
        if ((this._Altitude != value))
        {
          this._Altitude = value;
        }
      }
    }

    public int ID
    {
      get
      {
        return this._ID;
      }
      set
      {
        if ((this._ID != value))
        {
          this._ID = value;
        }
      }
    }

    public Nullable<double> Delay
    {
      get { return delay; }
      set { delay = value; }
    }


    public string Description
    {
      get { return description; }
      set { description = value; }
    }
    
    public string GetInfoString()
    {
      TimeSpan ts = new TimeSpan(0,0,0,(int) Delay);
      
      string result = String.Format("<b>{0}</b><br/>{1}<br/>", Name, Description);
      result += String.Format("Координаты:{0:F5},{1:F5}<br/>", Latitude, Longitude);
      result += String.Format("Скорость:{0}км/ч<br/>", Speed);
      result += String.Format("Пауза:{0}<br/>", ts.ToString());
      result += String.Format("Время:{0:t}<br/>", Time);
      return result;
    }
    
  }
}
